package com.thp.springBootDemo;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 消息生产者
 * @author lenovo
 *
 */
@RestController
public class QueueController {
	
	@Autowired
	private JmsMessagingTemplate jmsMessagingTemplate;
	
	@RequestMapping("/send")
	public void send(String text) {
		jmsMessagingTemplate.convertAndSend("dashabi", text);
	}
	
	@RequestMapping("/sendmap")
	public void seadMap() {
		Map map = new HashMap();
		map.put("mobile", "15716705527");
		map.put("template_code", "SMS_144941024");
		map.put("sign_name", "品优购");
		map.put("param", "{\"name\":\"贺俊\",\"called\":\"对不起,发错了,您的女朋友已经发货了\"}");
		jmsMessagingTemplate.convertAndSend("sms_map", map);
	}
	
}
